package com.ruibo.modules.system.domain;

import com.ruibo.jpa.model.AbstractAuditModel;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Set;

/**
 * @CLassName 岗位
 * @Description TODO
 * @Author 孙峰
 * @Date 2020/1/1 18:04
 * @Version 1.0
 */
@Entity
@Getter
@Setter
@Table(name = "sys_post")
public class SysPost extends AbstractAuditModel implements Serializable {
    private static final long serialVersionUID = 1L;


    /**
     * 岗位编码
     */
    @Column(name = "post_code", length = 64, nullable = false)
    private String postCode;

    /**
     * 岗位名称
     */
    @Column(name = "post_name", length = 64, nullable = false)
    private String postName;

    /**
     * 岗位排序
     */
    @Column(name = "post_sort", nullable = false)
    private Integer postSort;

    /**
     * 状态（0正常 1停用）
     */
    @Column(name = "status", nullable = false)
    private String status = "0";

    @JsonIgnore
    @ManyToMany(mappedBy = "sysPost")
    private Set<SysUser> sysUsers;


    public @interface Update {
    }
}
